import express = require('express');
import http = require('http');
import path = require('path');

// import routes = require('./routes/index');
// import user = require('./routes/user');

var app = express();

// all environments
app.set('port', process.env.PORT || 3000);
// app.set('/', path.join(__dirname, ''));
app.use(express.static(path.join(__dirname, '/')));
// app.set('view engine', 'jade');
// app.set('view engine', 'html');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
// app.use(app.router);

// import stylus = require('stylus');
// app.use(stylus.middleware(path.join(__dirname, 'public')));
// app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
    app.use(express.errorHandler());
}

app.get('/', function (req, res) {
    res.sendfile('index.html');
});
app.all('*',function(req, res, next){
    res.sendfile('index.html');
})

http.createServer(app).listen(app.get('port'), function () {
    console.log('Express server listening on port ' + app.get('port'));
});
